#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	double a, b, c;
	cin>>n;
	while(n--)
	{
		cin>>a>>b>>c;
		double delta = b*b-4*a*c;
		if(delta > 0)
			printf("x1=%.5f;x2=%.5f\n", (0-b+sqrt(delta))/(2*a), (0-b-sqrt(delta))/(2*a));
		else if(delta == 0)
			printf("x1=x2=%.5f\n", (0-b+sqrt(delta))/(2*a));
		else
			printf("x1=%.5f+%.5fi;x2=%.5f-%.5fi\n", (0-b)/2/a, sqrt(-delta)/2/a, (0-b)/2/a, sqrt(-delta)/2/a);
	}
	cout<<endl;
	system("pause");
	return 0;
}

